var toggle = function (params) {
    if (params) {
        if (params.table) {
            var table = $E(params.table);
            if (table) {
                var tHead = table.tHead;
                var tBodies = table.tBodies;
                var tFoot = table.tFoot;
                
                if (tHead) {
                    toggle({rows: tHead.rows, cellIndex: params.cellIndex, bool: params.bool});
                }
                if (tBodies && tBodies.length) {
                    for (var k = 0; k < tBodies.length; k += 1) {
                        toggle({rows: tBodies[k].rows, cellIndex: params.cellIndex, bool: params.bool});
                    }
                }
                if (tFoot) {
                    toggle({rows: tFoot.rows, cellIndex: params.cellIndex, bool: params.bool});
                }
            }
        } else if (params.rows && params.rows.length) {
            for (var i = 0; i < params.rows.length; i += 1) {
                var cells = params.rows[i].cells;
                if (cells &&  cells[params.cellIndex]) {
                    if (params.bool) {
                        cells[params.cellIndex].style.display = "";
                    } else {
                        cells[params.cellIndex].style.display = "none";
                    }
                }
            }
        }
    }
};